package promote.brozen.spring.event;

import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author Brozen
 * @date 2020/9/1 8:33 AM
 * @email brozen@qq.com
 */
@Component
public class EventListener implements ApplicationListener<MyEvent> {

    @Async
    @Override
    public void onApplicationEvent(MyEvent event) {
        System.out.println(String.format("Got event at %s", Thread.currentThread().getName()));
    }

}
